package org.dataframework.security.core.expression;

import net.sf.jsqlparser.expression.Expression;
import net.sf.jsqlparser.expression.ExpressionVisitor;
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
import net.sf.jsqlparser.schema.Column;
import org.dataframework.security.core.NotSupportException;

/**
 * @Author: LiuCf
 * @Email: 1316640406@qq.com
 * @Date: 2021/7/3 11:30
 */
public class HiddenExpression extends ASTNodeAccessImpl implements Expression {
    private String expression;

    public HiddenExpression() {
    }

    public HiddenExpression(String expression) {
        this.expression = expression;
    }

    public HiddenExpression(Column column) {
        this.expression = column.toString();
    }

    @Override
    public void accept(ExpressionVisitor expressionVisitor) {
        throw new NotSupportException();
    }

    @Override
    public String toString() {
        return "null as " + this.expression;
    }
}
